/** 
Flink 作业监控有关作业api
*/
const FLINK_SERVER_URL = "http://192.168.1.248:10001/";

class JarFormatter {
    constructor() {
    }

    entryFormatter(value, row) {
        if (row.entry && row.entry.length>0){
           return row.entry[0].name;
        }
        else{
            return "";
        }
        
    }

    operateFormatter(value, row) {
        return [
            '<button class="btn btn-sm btn-danger" onclick="removeJar(\'' + row.id + '\')">删除</button>',
            '<button class="btn btn-sm btn-info" onclick="showJobConfig(\'' + row.id + '\')">运行</button>'
        ].join(' ');
    }

    

    uploadedFormatter(value, row) {
        return new Date(value).toLocaleString();
    }
}





function buildUrl(url) {
    let _url = url == undefined || url == null ? FLINK_SERVER_URL : url;
    _url = _url.endsWith("/") ? _url : _url + "/";
    return _url;
}